<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>出入库申请审核</title>
    <link rel="stylesheet" th:href="@{/css/pintuer.css}">
    <link rel="stylesheet" th:href="@{/css/admin.css}">
    <script th:src="@{/js/jquery.js}"></script>
</head>
<body>
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder">出入库申请审核</strong></div>
    <table class="table table-hover text-center">
      <tr>
        <th width="120">id</th>
        <th>产品id</th>
        <th>产品名</th>
        <th>上家或下家</th>
        <th>入库or出库</th>
          <th>数量</th>
          <th>申请人</th>
        <th>操作</th>       
      </tr>
        <div th:each="warehouseApplicationDO:${warehouseApplicationDOS}">
            <tr>
              <td th:text="${warehouseApplicationDO.id}"></td>
              <td th:text="${warehouseApplicationDO.productId}"></td>
              <td th:text="${warehouseApplicationDO.productName}"></td>
              <td th:text="${warehouseApplicationDO.upDown}"></td>
              <td th:text="${warehouseApplicationDO.operation}"></td>
                <td th:text="${warehouseApplicationDO.operand}"></td>
                <td th:text="${warehouseApplicationDO.operatorId}"></td>
              <td>
                  <form class="button-group" th:action="@{/agreeApplication}">
                      <button class="button border-main" name="id" th:value="${warehouseApplicationDO.id}" onclick="return yes(1)"><span class="icon-check"></span>批准</button>
                  </form>
                  <form class="button-group" th:action="@{/refuseApplication}">
                      <button class="button border-red" name="id"  th:value="${warehouseApplicationDO.id}" onclick="return no(1)"><span class="icon-times"></span>否决</button>
                  </form>
              </td>
            </tr>
        </div>
      </tr>
    </table>
  </div>
<script type="text/javascript">
function yes(id){
	if(confirm("您确定要批准，并发送邮件通知吗?")){
		return true;
	}
	return false;
}
function no(id){
    if(confirm("您确定要否决,并发送邮件通知吗?")){
        return true;
    }
    return false;
}
</script>
</body></html>